<template>
  <div>
    <el-table v-loading="loading" tooltip-effect="darkTable" :data="dealServicingList" border height="280">
      <el-table-column :label="$t('投资主体')" align="center" prop="investorName" />
      <el-table-column :label="$t('投资本金') + $t('金额单位')" align="center" prop="amount" width="100">
        <template slot-scope="scope">
          <span>{{ moneyFormat(scope.row.amount, 'w') }}</span>
        </template>
      </el-table-column>
      <el-table-column :label="$t('年利率')" align="center" prop="interestRate" width="80">
        <template slot-scope="scope">
          <span>{{ moneyFormat(scope.row.interestRate) }}</span>
        </template>
      </el-table-column>
      <el-table-column :label="$t('起息日')" align="center" prop="valueDate" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.valueDate) }}</span>
        </template>
      </el-table-column>
      <el-table-column :label="$t('到期日')" align="center" prop="maturityDate" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.maturityDate) }}</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import { listDealServicing } from '@/api/deal/servicing/dealServicing'
  export default {
    name: 'DealServicingInfo',
    props: {
      // 公司ID
      bussId: {
        type: String,
        required: true
      }
    },
    data() {
      return {
        // 遮罩层
        loading: true,
        // 总条数
        total: 0,
        // 指标监控表格数据
        dealServicingList: [],
        // 查询参数
        queryParams: {
          dealId: this.bussId,
          pageNum: 1,
          pageSize: 10
        },
        // 表单参数
        form: {}
      }
    },
    created() {
      this.getList()
    },
    methods: {
      getList() {
        this.loading = true
        this.queryParams.dealId = this.bussId
        listDealServicing(this.queryParams).then(response => {
          this.dealServicingList = response.rows
          this.loading = false
        })
      }
    }
  }
</script>
